<?php

namespace app\admin\model;

use think\Model;

class Help extends Model
{
    protected $name = 'car_help'; //表名      默认类型
    protected $autoWriteTimestamp = true;
    protected $dateFormat = 'Y/m/d H:i:s';
    // 定义时间戳字段名
    protected $createTime = 'create_at';
    protected $updateTime = 'update_at';

    public function tabName()
    {
        return $this->hasOne('HelpTab', 'id', 'tab_id')->bind([
            'tab_name' => 'name',
        ]);
    }

    public function setHorAttr($value)
    {
        return $value ? 1 : 0;
    }

    public function getTagsAttr($value)
    {
        return $value == 1 ? true : false;
    }
    
}